/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 头部样式 */
header {
    background-color: #4a6fa5;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.score-container {
    font-size: 1.2rem;
    font-weight: bold;
}

/* 主内容样式 */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.game-screen {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.game-screen.hidden {
    display: none;
}

.game-screen h2 {
    color: #4a6fa5;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.game-screen p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* 按钮样式 */
button {
    background-color: #4a6fa5;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

button:hover {
    background-color: #3a5c85;
}

button:active {
    transform: translateY(2px);
}

/* 游戏区域样式 */
#game-container {
    padding: 0;
    overflow: hidden;
}

#game-area {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #e0f7fa;
    border: 2px solid #b2ebf2;
    overflow: hidden;
}

#player {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: #ff5722;
    border-radius: 50%;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.1s ease;
}

/* 游戏信息样式 */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
}

.lives {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hearts {
    display: flex;
    gap: 0.2rem;
}

.heart {
    color: #f44336;
    font-size: 1.2rem;
}

.level {
    font-weight: bold;
}

/* 游戏元素样式 */
.coin {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #ffeb3b;
    border-radius: 50%;
    animation: rotate 2s infinite linear;
}

.obstacle {
    position: absolute;
    background-color: #9e9e9e;
    border-radius: 4px;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 游戏结束画面样式 */
#game-over h2 {
    color: #f44336;
}

#final-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff9800;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .game-screen {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    #game-area {
        height: 300px;
    }
    
    #player {
        width: 30px;
        height: 30px;
    }
    
    .coin {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .game-screen {
        padding: 1rem;
    }
    
    .game-screen h2 {
        font-size: 1.5rem;
    }
    
    button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}